package com.literature.search.file.service.impl;

import com.literature.search.core.entity.FileDocument;
import com.literature.search.file.service.ITaskExecuteService;
import com.literature.search.file.task.thread.MainTask;
import com.literature.search.file.task.thread.TaskThreadPool;
import org.springframework.stereotype.Service;

/**
 * @Author: DangKong
 * @Date: 2023/3/3 14:36
 * @Description:
 */

@Service
public class TaskExecuteServiceImpl implements ITaskExecuteService {

    @Override
    public void execute(FileDocument fileDocument) {
        MainTask mainTask = new MainTask(fileDocument);
        TaskThreadPool.getInstance().submit(mainTask); //
    }
}
